package site.shihuan.helpdesk.security.annotation;

import org.apache.commons.lang3.StringUtils;
import site.shihuan.helpdesk.security.config.ActionTypes;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * TODO
 *
 * @author 周世焕
 * @Date 2021/1/17 08:07
 */
@Retention(RetentionPolicy.RUNTIME)
public @interface Secured {

    /**
     * The action type of the request.
     *
     * @return action type, default READ
     */
    ActionTypes action() default ActionTypes.READ;

    /**
     * The name of resource related to the request.
     *
     * @return resource name
     */
    String resource() default StringUtils.EMPTY;

}
